Conversation
Expose a local CDP websocket for webview-backed web blocks via the Electron debugger API. Adds wsh RPC + CLI commands (web cdp start/stop/status) and serves /json/list for DevTools discovery.
Require debug:webcdp to enable wsh web cdp, add secret-prefixed endpoints, and bind proxy to localhost only. Also document new debug settings and validate debug:remotedebugport.
Add `wsh web cdp` listing for web widgets, support `wsh web open --cdp` (with retry for webview readiness), and highlight web widgets with active CDP.
Show a CONTROLLED badge and use an amber highlight for web widgets with active CDP.
|
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
wsh web cdplists web widgets,wsh web open --cdpcreates + enables in one step (with a short retry for webview readiness).Guardrails / Security
debug:webcdp=trueis required; otherwisewsh web cdp startfails with a clear error.127.0.0.1(no non-loopback listen option)./__wave_cdp/<secret>/...for WS and/json/listto reduce accidental discovery; root/json/listreturns 404.debug:remotedebugportvalidated (1–65535) and bound to loopback.UX Details
wsh web cdpshows web widgets in the current workspace with CDP status + WS URL if active.wsh web cdp startwithout-buses the current web block if possible; otherwise it lists web widgets and hints to use-b.wsh web open --cdp(or-c) creates a web widget and starts CDP; includes a brief retry to handle async WebContents creation.Testing
go test ./cmd/wsh/cmdgo build ./cmd/wshdebug:webcdpgatewsh web cdplistingwsh web open --cdpsuccess/json/listworks; root/json/list404s